package com.lg.spring.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * Spring Boot 加载Filter的逻辑
 *
 * @author by Mr. Li 2020/9/16 15:29
 */
public class MyFilter implements Filter {
	@Override
	public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
		System.out.println("doFilter is register");

		// Filter拦截之后，需要将请求传递下去，不然所有的请求将会拦截在此处
		filterChain.doFilter(servletRequest, servletResponse);
	}
}
